import 'package:shared_preferences/shared_preferences.dart';

Future<bool?> addStr(String key, String value) async {
  SharedPreferences prefs = await SharedPreferences.getInstance();
  return await prefs.setString(key, value);
}

Future<bool?> addStrs(String key, List<String> value) async {
  SharedPreferences prefs = await SharedPreferences.getInstance();
  return await prefs.setStringList(key, value);
}

Future<String?> queryStr(String key) async {
  SharedPreferences prefs = await SharedPreferences.getInstance();
  return await prefs.getString(key);
}

Future<List<String>?> queryStrs(String key) async {
  SharedPreferences prefs = await SharedPreferences.getInstance();
  return await prefs.getStringList(key);
}

Future<bool?> delete(String key) async {
  SharedPreferences prefs = await SharedPreferences.getInstance();
  return await prefs.remove(key);
}

Future<bool?> deleteAll() async {
  SharedPreferences prefs = await SharedPreferences.getInstance();
  return await prefs.clear();
}
